Copyright(C) 1994 Terumasa KODAKA , Takeshi KONO ■CRT BIOS Terminology KCG Access Mode There are two types of KCG access mode: code access mode and dot access mode. o Code Access Mode In code access mode, 2-byte characters (such as kanji) can be displayed in the text VRAM. However, font reading from KCG and external character registration can only be done during the CRT's VSYNC (vertical synchronization) period. As the VSYNC duty ratio (percentage of the vertical synchronization period) is small as shown in the table below, it takes time to read or set a large number of fonts in this mode. You can check whether you are in the vertical synchronization period by checking the GDC status register bit 5 (I/O 0060h). --------------+---------------+-------------+--------------- CRT resolution|Horizontal scan|Vertical sync|VSYNC duty | Frequency | Frequency | --------------+---------------+-------------+--------------- 640x200 |15.98kHz |61.47Hz |3.1% 640x400 |24.83kHz |56.42Hz |1.8% 640x400 |31.47kHz |70.10Hz |0.45% 640x480 |31.47kHz |59.94Hz |0.38% 1120x750 |32.86kHz |79.09Hz |1.2% 1120x750 |50.02kHz |60.05Hz |1.2% --------------+---------------+-------------+--------------- Related INT 0Ah (External interrupt...VSYNC) o Dot access mode In dot access mode, 2-byte characters (such as kanji) cannot be displayed in the text VRAM. If you turn on text display and write 2-byte characters to the text VRAM, random 1-byte characters (which actually correspond to the character code) will be displayed. In exchange, you can always access the KCG, so you can read fonts and set external characters faster than in code access mode. Related INT 18h - Function 14h INT 18h - Function 1Ah INT 18h - Function 1Fh INT 18h - Function 20h I/O 0060h I/O 0068h - 0Ah,0Bh Terminology Term Attribute mode Sets the behavior of attribute bit 4 of the text VRAM. There are "vertical line mode" and "simple graphics mode." o Vertical line mode When bit 4 of the attribute is 1, vertical lines are displayed on the characters. o Simple graphics mode When bit 4 of the attribute is 1, the text data is interpreted as pixel data for simple graphics display and displayed. This is provided for compatibility with PC-8001 graphics. Terminology Dedicated high-resolution display and standard display o Dedicated high-resolution display This refers to the most common display in normal mode, capable of displaying 640x400 dots. The video signal has a horizontal scanning frequency of 24.83kHz, a vertical sync frequency of 56.42Hz, and is non-interlaced. When connecting this display, turn DIP SW 1-1 ON. o Standard display This refers to a display for PC-8001, capable of displaying 640x200 dots. The video signal has a horizontal scanning frequency of 15.98kHz, a vertical sync frequency of 61.47Hz, and is non-interlaced. When connecting this display, turn DIP SW 1-1 OFF. Terminology Extended Attribute o The PC-H98 has seven attribute modes (Figure 1). Standard attribute mode, extended attribute EGH mode, and JEH mode determine the attribute mode for the entire text screen. They can be set with INT 18h - Function 2Ah. Standard attribute mode is a mode that is fully compatible with the PC-9801 (Table 1). Only even addresses are valid in the attribute area. In extended attribute mode, odd addresses in the attribute area are also valid. The meaning of each bit in the odd address is as shown in Table 2 in EGH mode, and as shown in Table 3 in JEH mode. o Depending on the value of bit 1 and 0 in the odd address of the attribute area, EGL mode, EGH mode, and PC mode can be selected on a character-by-character basis. The meaning of each bit in the even address changes depending on the mode (Tables 4, 5, and 6). In modes where the same settings are available for even and odd addresses, the settings for the even addresses are valid. For example, in EGH+EGL mode, the background color can be specified for both even and odd addresses, but the background color setting for the odd address is ignored. Figure 1 [Attribute mode] ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ +----Standard Attribute Mode : | : : ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ | : : : : +----Extended Attributes - EGH Mode---+---EGL Mode : | : : +--JEL Mode : | : : +--PC Mode : | : : : : +----Extended Attributes - JEH Mode---+---EGL Mode : : : +--JEL Mode : : : +--PC Mode : : : : : ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ INT 18h - Select with Function 2Ah Select with odd address bits 1 and 0 in (affects the entire screen) the attribute area (selectable for each character) Determines the behavior of odd Determines the behavior of even addresses in the attribute area addresses in the attribute area Table 1 [In standard attribute mode] ・Odd addresses None ・Even addresses bit 7: G - Green (text color) bit 6: R - Red (text color) bit 5: B - Blue (text color) bit 4: VL - Vertical line (1=display, 0=no display) bit 3: UL - Underline (1=display, 0=no display) bit 2: RV - Reverse (1=inverted, 0=non-inverted) bit 1: BL - Blink (1=blink, 0=no blink) bit 0: ST - Secret (1=text display, 0=no display) [Display colors corresponding to G-R-B] +-------+---------------+ | G R B | Display color | +-------+---------------+ | 0 0 0 | Black | | 0 0 1 | Blue | | 0 1 0 | Red | | 0 1 1 | Magenta | | 1 0 0 | Green | | 1 0 1 | Cyan | | 1 1 0 | Yellow | | 1 1 1 | White | +-------+---------------+ * Odd addresses are not used Table 2 [Extended Attributes - EGH Mode] ・Odd Address bit 7: Ib - Brightness (Background Color) bit 6: Rb - Red (Background Color) bit 5: Gb - Green (Background Color) bit 4: Bb - Blue (Background Color) bit 3: OL - Overline (1=display, 0=no display) bit 2: If - Brightness (Character Color) bit 1,0: Mode specification for even address 10b=EGL mode 01b=JEL mode 00b=PC mode Table 3 [Extended Attributes - JEH Mode] ・Odd Address bit 7: 0 bit 6: DW - Double Width (1=Double Width, 0=Full Width) bit 5: DH - Double Height (1=Double Height, 0=Full Width) bit 4: UL - Double height area (1=top, 0=bottom) bit 3: LR - Double width area (1=right, 0=left) bit 2: If - Brightness (character color) bit 1,0: Mode specification for even addresses 10b=EGL mode 01b=JEL mode 00b=PC mode Table 4 [Extended attributes - EGL mode] ・Even addresses bit 7: Ib - Brightness (background color) bit 6: Rb - Red (background color) bit 5: Gb - Green (background color) bit 4: Bb - Blue (background color) bit 3: If - Brightness (character color) bit 2: Rf - Red (character color) bit 1: Gf - Green (character color) bit 0: Bf - Blue (character color) Table 5 [Extended attributes - JEL mode] ・Even addresses bit 7: BL - Blink (1=blink, 0=not blinking) bit 6: RV - Reverse (1=inverted, 0=not inverted) bit 5: VL - Vertical line (1=displayed, 0=not displayed) bit 4: UL - Underline (1=displayed, 0=not displayed) bit 3: If - Brightness (text color) bit 2: Rf - Red (text color) bit 1: Gf - Green (text color) bit 0: Bf - Blue (text color) Table 6 [Extended Attributes - PC Mode] ・Even Address bit 7: G - Green (Text Color) bit 6: R - Red (Text Color) bit 5: B - Blue (Text Color) bit 4: VL - Vertical Line (1=Display, 0=No Display) bit 3: UL - Underline (1=Display, 0=No Display) bit 2: RV - Reverse (1=Inverted, 0=Non-Inverted) bit 1: BL - Blink (1=Blink, 0=No Blink) bit 0: ST - Secret (1=Text Display, 0=No Display) Table 7 [I-R-G-B and Corresponding Display Colors] +---------+------------------------------+ | I R G B | Display Color | +---------+------------------------------+ | 0 0 0 0 | Black | | 0 0 0 1 | Dark Blue | | 0 0 1 0 | dark green | | 0 0 1 1 | dark cyan | | 0 1 0 0 | dark red | | 0 1 0 1 | dark magenta | | 0 1 1 0 | dark brown (not dark yellow) | | 0 1 1 1 | gray | +---------+------------------------------+ | 1 0 0 0 | dark gray (not black) | | 1 0 0 1 | blue | | 1 0 1 0 | green | | 1 0 1 1 | cyan | | 1 1 0 0 | red | | 1 1 0 1 | magenta | | 1 1 1 0 | yellow | | 1 1 1 1 | white | +---------+------------------------------+ INT 18h - Function 0Ah (Normal) Category CRT BIOS Name CRT mode setting Target Normal Input AH=0Ah AL=Mode setting information bit 7-5: Set 000b bit 4: Number of lines [PC-98GS, PC-9821 (excluding Bf, Bp, Bs, Be, Ts)] (Undocumented) 1 = 30 lines 0 = 20/25 lines (startup setting) * This bit is only valid in 640x480 mode. It is ignored in other modes. bit 3: KCG (Kanji character generator) access mode [except for the first PC-9801] 1 = Dot access 0 = Code access (initial setting) * The first PC-9801 is always in the same state as code access mode bit 2: Attribute mode 1 = Simple graphics (initial setting) 0 = Vertical lines bit 1: Number of columns 1 = 40 columns (initial setting when DIP SW 2-3 is OFF) 0 = 80 columns (initial setting when DIP SW 2-3 is ON) * Depending on the model, DIP SW 2-3 is fixed to ON bit 0: Number of lines 1 = 20/30 lines 0 = 25 lines ------+-------+-----------------+------------------------------------ bit 4 | bit 0 | Number of lines | Notes ------+-------+-----------------+------------------------------------ 0 | 1 | 20 lines | Initial setting when DIP SW 2-4 is OFF 0 | 0 | 25 lines | Startup setting when DIP SW 2-4 is ON 1 | 1 | 30 lines | Can only be set when displaying 640x480 1 | 0 | --- | Setting prohibited ------+-------+----+------------------------------------ Output None Explanation o Sets the text screen display mode. Sends commands to the text GDC and line counter control circuit. u When this function is executed, if there is another routine that continues to use the VSYNC interrupt, the VSYNC interrupt of that routine will stop. This is because INT 18h - Function 10h is called during processing. u When using 640x480 mode on PC-98GS and PC-9821 (excluding Bf, Bp, Bs, Be, and Ts), 30 lines can be set. However, the MS-DOS CON device driver does not support 30 line mode. u In 640x480 mode, if this function is executed with bit 4=1 and bit 0=0, an error occurs and the function returns without performing any processing (no other bits are set, and the display is not turned off). No error is reported. In 640x400 CRT resolution mode, the state of AL bit 4 is ignored. u In 640x480 mode only, executing this function turns the text display OFF. To turn it ON, execute INT 18h - Function 0Ch. In 640x400 CRT resolution mode, the ON/OFF state of the text display does not change. o When set to 40-column mode, the character width is doubled. The text VRAM only uses addresses of even-numbered digits (the leftmost digit is counted as 0th digit) in 80-column mode. In 640x480 mode, this function can also be used to set the display to 40 columns. However, the MS-DOS CON device driver does not support 40-column mode. o AL bits 7-5 cannot be set because they correspond to AL bits 7-5 of the output of INT 18h - Function 0Bh (normal). o The initial value of the attribute mode set by the BIOS is simple graphics mode. However, after MS-DOS starts, it is set to vertical line mode. Related INT 18h - Function 0Bh (normal) INT 18h - Function 30h 0000:053Ch INT 18h - Function 0Ah (Hi-Res) Classification CRT BIOS Name CRT mode setting Target Hi-Res Input AH=0Ah AL=Mode setting information bit 7-5: Set 000b (unused) bit 4: Number of lines 1 = 31 lines 0 = 25 lines (startup setting) bit 3: KCG access mode 1 = Dot access 0 = Code access (startup setting) bit 2-0: Set 000b (unused) Output None Explanation o Sets the text screen display mode. Sends commands to the text GDC and line counter control circuit. o In Hi-Res mode, the attribute mode and number of display digits cannot be changed. The attribute is always in the same state as in vertical line mode. u This function waits for the next VSYNC to occur before executing the actual process. The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue generating VSYNC interrupts, you will need to OUT to I/O 0064h after executing this function. Related INT 18h - Function 0Bh (Hi-Res) INT 18h - Function 1Ch 0000:0546h INT 18h - Function 0Ah (LT/HA) Classification CRT BIOS Name CRT mode setting Target PC-98LT/HA Input AH=0Ah AL=mode setting information bit 7: Character type (Undocumented) Cannot be changed directly with this function. The value of this bit is always ignored. bit 6-1: Set 000000b (unused) bit 0: Number of lines 1 = 20 lines 0 = 25 lines (startup setting) Output None Explanation o Sets the text screen display mode (number of lines displayed). o On PC-98LT/HA, attribute mode and number of displayed digits cannot be changed. Attributes are always in the same state as vertical line mode. o Since it does not have a CRT interface, there is no setting for KCG (Kanji character generator) access mode. It is always in the same state as dot access mode. u The setting value of this function is stored in 0000:053Ch. Bit 7 of 0000:053Ch indicates the display character font, but cannot be changed by this function. You can change it by directly setting bit 7=1 in 0000:053Ch and then executing this function. Related INT 18h - Function 0Bh(LT・HA) 0000:053Ch INT 18h - Function 0Bh (Normal) Classification CRT BIOS Name CRT mode sense Target Normal Input AH=0Bh Output AL=Mode information bit 7: CRT type 1 = Dedicated high-resolution display (when DIP SW 1-1 is ON) 0 = Standard display (when DIP SW 1-1 is OFF) bit 6: Waiting for VSYNC detection (for CRT BIOS work) Related: 0000:053Ch bit 5: Unused bit 4: Number of lines [PC-98GS, PC-9821 (excluding Bf, Bp, Bs, Be, Ts)] (Undocumented) 1 = 30 lines 0 = 20/25 lines (startup setting) bit 3: KCG (Kanji character generator) access mode 1 = Dot access 0 = Code access (startup setting) * Disabled on the original PC-9801 (always in code access state) bit 2: Attribute mode 1 = Simple graphics (startup setting) 0 = Vertical lines bit 1: Number of columns 1 = 40 columns (startup setting when DIP SW 2-3 is OFF) 0 = 80 columns (startup setting when DIP SW 2-3 is ON) bit 0: Number of lines 1 = 20/30 lines 0 = 25 lines ------+-------+-----------------+------------------------------------ bit 4 | bit 0 | Number of lines | Notes ------+-------+-----------------+------------------------------------ 0 | 1 | 20 lines | Startup setting when DIP SW 2-4 is OFF 0 | 0 | 25 lines | Startup setting when DIP SW 2-4 is ON 1 | 0 | --- | Unused 1 | 1 | 30 lines | Can only be set when displaying 640x480 ------+-------+-----------------+------------------------------------ Explanation o Gets the current CRT mode status. Just returns the value of 0000:053Ch. o Bit 6 is a working bit for the CRT BIOS and is normally 0. For details, see the section on the system common area 0000:053Ch. o Bits 4 and 0 are also reflected when changed with INT 18h - Function 30h. Related INT 18h - Function 0Ah (Normal) INT 18h - Function 30h INT 18h - Function 31h 0000:053Ch INT 18h - Function 0Bh (Hi-Res) Classification CRT BIOS Name CRT mode sense Target Hi-Res Input AH=0Bh Output AL=Mode information bit 7: Always 1 (indicates high resolution display) bit 6,5: Always 00b (unused) bit 4: Number of lines 1 = 31 lines 0 = 25 lines (initial setting) bit 3: KCG (Kanji character generator) access mode 1 = Dot access 0 = Code access (initial setting) bit 2: Always 0 (indicates vertical line mode) bit 1: Always 0 (indicates 80 columns) bit 0: Always 0 (unused) Explanation o Gets the current CRT mode status. u Returns the value read from 0000:0546h with all bits except bits 4 and 3 set to 0 and bit 7 set to 1. Related INT 18h - Function 0Ah (Hi-Res) 0000:0546h INT 18h - Function 0Bh (LT/HA) Category CRT BIOS Name CRT mode sense Target PC-98LT/HA Input AH=0Bh Output AL=Mode information bit 7: Character type (Undocumented) 1 = Dedicated high-resolution display font (initial setting) 0 = Standard display font bit 6-1: 000000b bit 0: Line mode 1 = 20 lines 0 = 25 lines (initial setting) Explanation o Gets the current CRT mode status. u Just returns the value of 0000:053Ch. u Bit 7 indicates the display character font, but cannot be changed with INT 18h - Function 0Ah (LT/HA). You can change it by directly setting bit 7=1 in 0000:053Ch, then executing INT 18h - Function 0Ah(LT・HA). Related INT 18h - Function 0Ah(LT・HA) 0000:053Ch INT 18h - Function 0Ch Classification CRT BIOS Name Start displaying text screen Target Normal, Hi-Res Input AH=0Ch Output None Explanation o Turns on the display of the text VRAM. Sends the START (display start) command to the text GDC. u In the Hi-Res mode of the PC-9801 original, E, F, M, U, VM2, and VF, PC-98XA, XL, XL^2, RL, PC-H98, and PC-9821Af, Ap, As, Ae, Ap2, and As2, the screen may flicker the moment this function is executed. To eliminate the flicker, wait for VSYNC before executing this function. In the normal mode of the PC-9801UV2 and later, the BIOS contains a process to wait for VSYNC. To know the timing of the VSYNC occurrence, the GDC status (I/O 0060h) is checked. For this reason, VSYNC interrupts being used by other routines, such as INT 18h - Function 0Eh, will not stop. u There is no area in the system common area to save the state set by this function. Related INT 18h - Function 0Dh INT 18h - Function 0Ch(LT・HA) Category CRT BIOS Name Starts displaying text and graphics Target PC-98LT・HA Input AH=0Ch Output None Explanation o Turns on the VRAM display. o On the PC-98LT・HA, the text screen is also written to the graphic VRAM, so both must be turned on at the same time. Related INT 18h - Function 0Dh(LT・HA) INT 18h - Function 0Dh Category CRT BIOS Name Stop displaying text screen Target Normal, High-Resolution Input AH=0Dh Output None Explanation o Turns off displaying text VRAM. Sends a STOP command to the text GDC. Related INT 18h - Function 0Ch INT 18h - Function 0Dh(LT・HA) Category CRT BIOS Name Stops displaying text and graphics Target PC-98LT・HA Input AH=0Dh Output None Explanation o Turns off displaying VRAM. o In PC-98LT・HA, text screens are also written to graphic VRAM, so always turn off both at the same time. Related INT 18h - Function 0Ch(LT・HA) INT 18h - Function 0Eh Classification CRT BIOS Name Setting one display area Target Normal, High Resolution, PC-98LT/HA Input AH=0Eh DX=Text VRAM display start offset address Output DX=Undefined Explanation o Specifies the text VRAM area to be displayed on the screen. Use this function when you want to display one continuous area on the text VRAM on the entire screen. u Data from the address specified in the DX register onwards will be displayed from the top left of the screen. However, specify a multiple of 4 in the DX register. If you specify a number other than a multiple of 4, the display will not be as you intended. o At startup, it is the same as executing this function with DX=0000h. o In the case of PC-98LT/HA, specify the offset address of the emulation VRAM. u This function waits for the next VSYNC to occur before executing the actual process (except PC-98LT/HA). The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue generating VSYNC interrupts, you need to OUT to I/O 0064h after executing this function. o Uses the text GDC SCROLL command (except PC-98LT/HA). Related INT 18h - Function 0Fh Figure Text VRAM Screen display A000:0000h→+----------+ ―――――――――― DX→|ABCDEFG・・・|………………………………|ABCDEFG | | | | | | | | | | | | | |・・・PC-9801|………………………………| PC-9801| | | ―――――――――― | | | | | | +----------+ * The text VRAM segments in the figure are for normal mode. In high-resolution mode, it is E000h, and in PC-98LT/HA, it is the emulation VRAM segment. INT 18h - Function 0Fh Category CRT BIOS Name Setting multiple display areas Target Normal, High Resolution, PC-98LT/HA Input AH=0Fh BX:CX=Top address of display area list DH=Display area number n (0-3) to change settings DL=Number of display areas m (1-4) (n + m ≦ 4) <Format of display area list> ----------------+----------------------------------- Address | Content ----------------+----------------------------------- BX:CX+00h(WORD) | Start offset address of display area n+0 BX:CX+02h(WORD) | Number of lines in display area n+0 BX:CX+04h(WORD) | Start offset address of display area n+1 BX:CX+06h(WORD) | Number of lines in display area n+1 BX:CX+08h(WORD) | Start offset address of display area n+2 BX:CX+0Ah(WORD) | Number of lines in display area n+2 BX:CX+0Ch(WORD) | Start offset address of display area n+3 BX:CX+0Eh(WORD) | Number of lines in display area n+3 ----------------+----------------------------------- Output None Explanation o Specifies the text VRAM area to be displayed on the screen. Use this function when displaying multiple areas on the text VRAM on the screen. The screen can be divided into up to four areas by line. You can specify the number of lines for each area and the address on the text VRAM to display. The specified text VRAM data is displayed from the top left of each area on the screen. o DL specifies how many divisions the screen will be made into. DH specifies the top number of the display area to be changed. In other words, the parameters will be changed from the display area specified by DH to the display area of DH+DL-1. o BX:CX specifies the top address of the memory that stores the display area list. The display area list prepares the number of data items specified by DL. Specify a multiple of 4 for the start offset address of the display area. If you specify a number other than a multiple of 4, the display will not be as you intended. The sum of the number of lines in each display area must be the same as the number of lines displayed. If the sum exceeds the number of lines displayed, the excess part will not be displayed. Operation is not guaranteed if the sum is smaller than the display area. In reality, the contents from display area #0 are displayed repeatedly, but the characters may become distorted. u If you set a value such that DH + DL > 4, wraparound will occur. For example, if you specify DH=3 and DL=2, you can set display area 3 and display area 0. However, since this usage is not specified in the GDC manual, it is better not to create programs that use this characteristic. u The technical data book states that the start address of the text VRAM is specified by the GDC address, but it is specified by the offset address of the CPU address. In the case of PC-98LT-HA, you specify the offset address of the emulation VRAM. u This function waits for the next VSYNC occurrence before executing actual processing (except PC-98LT/HA). The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue to generate VSYNC interrupts, you will need to send an OUT to I/O 0064h after executing this function. o The text GDC SCROLL command is used (except PC-98LT/HA). Figure Text VRAM Screen display A000:0000h→+----------+ ――――――――――― Top of area #0→|DTC-77ES |………………………………………………|DTC-77ES | | | | | |・・・・・・・・・・|………………………………………………|EV-BS3000| | | …… | | Top of area #1→|EV-BS3000 |…… ……| CLD-919 | | | …… | | Top of area #2→| CLD-919 |…… ……| WM-DT1 | | | …… | | |・・・・・・・・・・|…… …… ――――――――――― | | …… Top of area #3→| WM-DT1 |…… | | +----------+…… * The text VRAM segment in the figure is for normal mode. In high-resolution mode, it is E000h, and in PC-98LT/HA, it is the emulation VRAM segment. o Displaying multiple areas is done using the functions of the text GDC. Here we will briefly explain how the text GDC displays the text screen. ●Registers in the text GDC The text GDC has four sets of registers that store information about the display area (see the diagram below). Each set of registers can store the number of lines in the display area and the starting address of the text VRAM. [Registers in Text GDC] +------------------------------------------------+ |Text VRAM start address of display area 0 (SAD1)| |Number of lines in display area 0 (SL1) | |Text VRAM start address of display area 1 (SAD2)| |Number of lines in display area 1 (SL2) | |Text VRAM start address of display area 2 (SAD3)| |Number of lines in display area 2 (SL3) | |Text VRAM start address of display area 3 (SAD4)| |Number of lines in display area 3 (SL4) | +------------------------------------------------+ ●Screen display procedure When displaying the screen, the text GDC references the contents of this register to generate the address of the text VRAM to be displayed. First, it displays the contents of the text VRAM for the number of lines specified by SL1, starting from the address specified by SAD1. If the number of lines displayed is less than the maximum number of lines (20, 25, or 31 lines on the PC-9800), the text VRAM contents are displayed starting from the address specified by SAD2 for the number of lines specified by SL2. The same process is repeated until the number of lines displayed reaches the maximum number of lines. ●How to rewrite register contents The contents of a register can be rewritten by issuing a SCROLL command to the text GDC. When rewriting the contents of a register with the SCROLL command, it is not necessary to rewrite all of the contents. Only any parameter in the register can be rewritten. For example, it is possible to change only the value of SL2 (however, in INT 18h - Function 0Fh, the start address and number of lines must always be changed as a pair). ●Changes in display due to rewriting register contents For example, consider a case where three areas are displayed. If the number of lines in display area 1 is reduced, the display position of display area 2 on the screen will be raised. Conversely, if the number of lines in display area 1 is increased, the display position of display area 2 will be lowered. Furthermore, even if the parameters for display area 3 are changed, the screen display will not change. ●Startup state The text VRAM start address for display area 0 is set to 0000h, and the number of lines in display area 0 is set to the same value as the number of lines displayed on the text screen. In other words, one display area is set. ●Other The text VRAM start addresses for each area do not necessarily have to be in ascending order. Related INT 18h - Function 0Eh INT 18h - Function 10h Classification CRT BIOS Name Cursor type setting Target Normal, Hi-Res, PC-98LT/HA Input AH=10h AL=cursor blink 00h: blink 01h: always on Output None Explanation o Sets whether to blink the cursor. u Executing this function turns off the cursor display. If you need to display the cursor, execute INT 18h - Function 11h. u Some technical data books state the meaning of the AL value in reverse. u In normal mode, the current cursor blink state is not saved in the system common area. In Hi-Res and PC-98LT/HA, it is saved. o In Hi-Res mode, you can change the blink speed and cursor shape with INT 18h - Function 1Ch,1Eh. In normal mode and PC-98LT/HA, you cannot change the blink speed or shape in the BIOS. Normal mode can be changed by issuing a CSRFORM command to the text GDC. u This function waits for the next VSYNC occurrence before executing the actual processing (except PC-98LT/HA). The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt of that routine. If you want to continue to generate VSYNC interrupts, you need to OUT to I/O 0064h after executing this function. o The CSRFORM command of the text GDC is used (except PC-98LT/HA). Related INT 18h - Function 11h INT 18h - Function 1Ch[Hi-Res] INT 18h - Function 1Eh[Hi-Res] 0000:0452h[Hi-Res] 0000:04F0h[PC-98LT/HA] INT 18h - Function 11h Classification CRT BIOS Name Start displaying cursor Target Normal, Hi-Res, PC-98LT/HA Input AH=11h Output None Explanation o Turns cursor display ON. u In normal mode, the current cursor ON/OFF state is not saved in the system common area. In Hi-Res and PC-98LT/HA, it is saved. o Uses the CSRFORM command of the text GDC (except PC-98LT/HA). Related INT 18h - Function 12h 0000:053Bh 0000:0452h [Hi-Res] 0000:04F0h [PC-98LT・HA] INT 18h - Function 12h Category CRT BIOS Name Stop cursor display Target Normal, Hi-Res, PC-98LT・HA Input AH=12h Output None Explanation o Turns cursor display OFF. u In normal mode, the current cursor ON/OFF state is not saved in the system common area. In Hi-Res and PC-98LT・HA, it is saved. o Uses the CSRFORM command of the text GDC (except PC-98LT・HA). Related INT 18h - Function 11h 0000:053Bh 0000:0452h [Hi-Res] INT 18h - Function 1Ch [Hi-Res] 0000:04F0h [PC-98LT/HA] INT 18h - Function 13h Category CRT BIOS Name Set cursor position Target Normal, Hi-Res, PC-98LT/HA Input AH=13h DX=Cursor position (text VRAM offset address) Output None Explanation o Moves the cursor to the screen position corresponding to the address specified by the DX register. Specify an even number as the value. u Except for PC-98LT/HA, the current cursor position is not saved in the system common area. The cursor position can be obtained by issuing a CSRR command to the text GDC. o Uses the CSRW command of the text GDC (except PC-98LT/HA). Related 0000:04F2h[PC-98LT・HA] INT 18h - Function 14h Classification CRT BIOS Name Read font pattern (16 dots) Target Normal, PC-98LT/HA Input AH=14h BX:CX=First address of font pattern buffer DX=Character code (1) 6x7 dot font (ANK font for 640x200 display) DH=00h DL=Character code (00-FFh) * Specify 00-1Fh to read control characters, and 80-9Fh and E0-FFh to read graphic characters. (2) 7x13 dot font (ANK font for 640x400 display) DH=80h DL=Character code (00-FFh) * Specify 00-1Fh to read control characters, and 80-9Fh and E0-FFh to read graphic characters. (3) 8x16 dot font (2 bytes half-width) DX = JIS kanji code (2921-297Eh, 2A21-2A7Eh, 2B21-2B7Eh) * Set the first byte to DH and the second byte to DL * For PC-H98, external characters 7840-787Eh, 7D21-7D7Eh, 7E21-7E7Eh are also 2 bytes half-width (4) 16x16 dot font (2 bytes full-width) DX = JIS kanji code * Set the first byte to DH and the second byte to DL Output AH=Undefined BX=Undefined CX=Undefined DX=Undefined <Font pattern buffer format> ----------------+----------------------------------- Address | Contents ----------------+----------------------------------- BX:CX+00h(BYTE) | Number of dots in vertical direction | 01h= 8 dots | 02h=16 dots BX:CX+01h(BYTE) | Number of dots in horizontal direction | 01h= 8 dots | 02h=16 dots BX:CX+02h~ | Font pattern data | 6x7 dot font...8 bytes | 7x13,8x16 dot font...16 bytes | 16x16 dot font...32 bytes ----------------+----------------------------------- <Font pattern data format> (1) 6x7 dot font ---------------+----------------------------------------------- Address | Contents ---------------+----------------------------------------------- BX:CX+02h | Top of font (bit 7=left edge of character, bit 0=right edge of character) : | BX:CX+09h | Bottom of font (bit 7=left edge of character, bit 0=right edge of character) ---------------+----------------------------------------------- +-----+ 1st line | +02h| +-----+ 2nd line | +03h| +-----+ : | : | +-----+ 8th line | +09h| +-----+ (2) 7x13,8x16 dot font ---------------+----------------------------------------------- Address | Contents ---------------+----------------------------------------------- BX:CX+02h | Top of font (bit 7=left edge of character, bit 0=right edge of character) : | BX:CX+11h | Bottom edge of font (bit 7=left edge of character, bit 0=right edge of character) ---------------+----------------------------------------------- +-----+ 1st line | +02h| +-----+ 2nd line | +03h| +-----+ : | : | +-----+ 16th line | +11h| +-----+ (3)16x16 dot font ---------------+----------------------------------------------- Address | Contents ---------------+----------------------------------------------- BX:CX+02h | Top left half of font (bit 7=left edge of character) BX:CX+03h | Top right half of font (bit 0=right edge of character) : | BX:CX+20h | Bottom left half of font (bit 7=left edge of character) BX:CX+21h | Bottom right half of font (bit 0=right edge of character) ---------------+----------------------------------------------- +-----+-----+ 1st line | +02h| +03h| +-----+-----+ 2nd line | +04h| +05h| +-----+-----+ : | : | : | +-----+-----+ 16th line | +20h| +21h| +-----+-----+ Description o Writes the pattern data of the specified font to the buffer. The pattern data is read from the ANK/Kanji/External Character Generator (however, the original PC-9801 did not have an External Character Generator). o In the Technical Data Book, the two types of 1-byte ANK fonts are written as 6x7 dot font and 7x13 dot font to distinguish them. However, both are actually fonts with a maximum size of 8x8 dots and 8x16 dots (the box-shaped graphic character with ASCII code 87h corresponds to this). In this book, we follow the Technical Data Book and use the notation 6x7 dot font and 7x13 dot font. Also, the 7x13 dot font and the 8x16 dot font are both fonts with a maximum size of 8x16 dots, but the font designs are different. u In the Technical Data Book, a Hiragana font is written in the table titled "List of half-width characters that can be displayed on the graphic screen", but this font cannot be obtained by the BIOS. As written in the notes to that table, it only exists in the Graph LIO ROM. u When reading out a font of 2-byte characters with this function, processing is completed faster when the KCG access mode is set to dot access mode. This is because in dot access mode, the KCG is always accessible. In code access mode, the KCG can only be accessed during the VSYNC period, so it takes time. See "Term: KCG access mode". When reading out a font of ANK characters, the processing time is the same regardless of the KCG access mode. This is because the character generator can only be accessed during the VSYNC period. u When the KCG access mode is set to code access mode, this function waits for the next VSYNC to occur before executing the actual processing (except for PC-98LT/HA). To know the timing of the VSYNC occurrence, it uses the VSYNC interrupt (INT 0Ah). If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue generating VSYNC interrupts, after executing this function, OUT to I/O 0064h is required. u When executed in high-resolution mode, the font pattern buffer from offset +02h onwards will be filled with FFh for the number of bytes according to the specified font. Values are also set to offsets +00h and +01h. At +00h, 08h is set when the vertical number of dots is 8, and 10h is set when it is 16. +01h is the same as in normal mode. Related INT 18h - Function 1Ah INT 18h - Function 15h Classification CRT BIOS Name Read light pen position Target Normal (excluding some models) Input AH=15h Output AH=Light pen status 00h: Pressed 01h: Not pressed * On machines that do not support light pen, 01h is always returned ■When AH=00h DX=Text VRAM offset address corresponding to the pressed position Explanation o Returns the light pen pressed status and the text VRAM offset address corresponding to the position where the pen was pressed. o Uses the LPEN command of the text GDC to obtain the light pen position. u Even in normal mode, models that do not have a monochrome connector or a digital RGB/monochrome connector do not support light pens. Of the models that have a digital RGB/monochrome connector, the PC-9801FA/FS/FX/US do not support this function. u When executed in high-resolution mode, 01h is always returned. Related INT 18h - Function 19h INT 18h - Function 16h Classification CRT BIOS Name Initialization of text VRAM Target Normal, High Resolution, PC-98LT/HA Input AH=16h DH=Data to fill attribute area bit 7: G - Green bit 6: R - Red bit 5: B - Blue bit 4: VL - Vertical line (1=display, 0=no display) bit 3: UL - Underline (1=display, 0=no display) bit 2: RV - Reverse (1=inverted, 0=non-inverted) bit 1: BL - Blink (1=blink, 0=non-blink) bit 0: ST - Secret (1=character display, 0=no display) DL=Character code to fill character area (00-FFh) Output AH=Undefined DX=Undefined Explanation o Fills the entire text VRAM area with the specified character and attributes. Odd addresses in the text VRAM character area are filled with 00h, so they cannot be cleared with 2-byte characters. o PC-98LT・HA does not support bit 1 (blink). Also, characters are displayed with bits other than 7-5=000b. Related INT 18h - Function 16h (H98) Classification CRT BIOS Name Initialize text VRAM (in extended attribute mode of PC-H98) Target PC-H98 Input AH=16h DL=Character code to fill character area (00-FFh) DH=Data to fill extended attribute area (even address) BL=Data to fill extended attribute area (odd address) Output AH=Undefined BL=Undefined DX=Undefined Explanation o Fills the entire text VRAM area with the specified character and attribute. In extended attribute mode of PC-H98, attributes are 16 bits wide. Odd addresses in the text VRAM character area are filled with 00H, so they cannot be cleared with 2-byte characters. In the PC-H98 series technical data book, the BP register is undefined after the function is executed, but in reality it does not change. Related term: Extended attribute INT 18h - Function 17h Classification CRT BIOS Name Buzzer call Target Normal, Hi-Res Input AH=17h Output None Explanation o Turns on the buzzer. The buzzer does not stop automatically and continues to ring. o In Hi-Res mode, it rings at the frequency set in INT 18h - Function 23h. o In normal mode, the buzzer frequency cannot be changed in the BIOS, but it can be changed by directly accessing 8253A (I/O 3FDBh) (excluding the original PC-9801 E, F, and M). u Only the '86 Technical Data Book states that the AH register becomes undefined after the function is executed, but in reality it does not change. u PC-98LT and HA do not support this function. Related INT 18h - Function 18h I/O 0035h bit 3 I/O 3FDBh INT 18h - Function 23h[Hi-Res] INT 18h - Function 24h[Hi-Res] INT 1Ch - Function 06h[Hi-Res] INT 18h - Function 18h Classification CRT BIOS Name Stop buzzer Target Normal, Hi-Res Input AH=18h Output None Explanation o Turns the buzzer off. u Only in the '86 Technical Data Book is it stated that the AH register becomes undefined after the function is executed, but in reality it does not change. u PC-98LT-HA does not support this function. Related INT 18h - Function 17h I/O 0035h bit 3 INT 18h - Function 19h Classification CRT BIOS Name Initialize light pen pressed state Target Normal Input AH=19h Output AH=Undefined Explanation o Execute before obtaining the light pen state with INT 18h - Function 15h. u Even in normal mode, models that do not have a monochrome connector or a digital RGB/monochrome dual connector do not support the light pen. Even models that have a digital RGB/monochrome dual connector, the PC-9801FA/FS/FX/US do not support this function. u Does not work in high-resolution mode. Related INT 18h - Function 15h INT 18h - Function 1Ah Classification CRT BIOS Name User character definition (16 dots) Target Normal (excluding PC-9801 first generation and PC-H98), PC-98LT/HA Input AH=1Ah BX:CX=First address of font pattern buffer (34 bytes) <Font pattern buffer format> ----------------+----------------------------------- Address | Contents ----------------+----------------------------------- BX:CX+00h(WORD) | Work area BX:CX+02h~ | Font pattern data (32 bytes) ----------------+----------------------------------- <Font pattern data format> ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- BX:CX+02h | Left half of top edge of font (bit 7=left edge of character) BX:CX+03h | Right half of top edge of font (bit 0=right edge of character) : | BX:CX+20h | Left half of bottom edge of font (bit 7 = left edge of character) BX:CX+21h | Right half of bottom edge of font (bit 0 = right edge of character) ---------------+----------------------------------- +-----+-----+ 1st line | +02h| +03h| +-----+-----+ 2nd line | +04h| +05h| +-----+-----+ : | : | : | +-----+-----+ 16th line | +20h| +21h| +-----+-----+ DX=Registered character code ---------------+------------------------+-------------------- Model | JIS kanji code | Actually | Registerable values | Registerable values | within range | ---------------+------------------------+-------------------- PC-9801E・F・M・U | 7621-765Fh | 7620-765Fh | (Total 63 characters) | (Total 64 characters) Others | 7621-767Eh | 7601-7680h | 7721-777Eh | 7701-7780h | (Total 188 characters) | (Total 256 characters) ---------------+------------------------+-------------------- Output AH=Undefined BX=Undefined CX=Undefined DX=Undefined Explanation o Registers 16x16 dot user-defined characters to the external character generator. The original PC-9801 does not have an external character function. o The character codes that can be registered vary depending on the model. If used within the range of JIS kanji codes, there are 63 or 188 characters. In reality, the external character generator has space for 64 or 256 characters. Shift JIS cannot handle codes outside the range of JIS kanji codes, but if you write the character code directly to the text VRAM, it can be displayed on the screen. u When registering a font with this function, processing is completed faster when the KCG access mode is set to dot access mode. This is because in dot access mode, the KCG can be accessed at all times. In code access mode, the KCG can only be accessed during the VSYNC period, so it takes time. See "Term: KCG access mode". u When the KCG access mode is set to code access mode, this function waits for the next VSYNC to occur before executing actual processing (excluding PC-98LT/HA). The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt of that routine. If you want to continue generating VSYNC interrupts, you need to OUT to I/O 0064h after executing this function. u Does not work in high-resolution mode. Related INT 18h - Function 14h INT 18h - Function 1Ah (H98) Classification CRT BIOS Name User character definition (16x16 dots, 8x16 dots) Undocumented Target PC-H98 + Normal Input AH=1Ah BX:CX=First address of font pattern buffer <Font pattern buffer format> -----------------+----------------------------------- Address | Contents -----------------+----------------------------------- BX:CX+00h (BYTE) | Work area BX:CX+02h~ | Font pattern data | 8x16 dot font...16 bytes | 16x16 dot font...32 bytes -----------------+----------------------------------- <Font pattern data format> (1)8x16 dot font -----------------+----------------------------------- Address | Contents -----------------+----------------------------------- BX:CX+02h | Top of font (bit 7=left end of character, bit 0=right end of character) : | BX:CX+11h | Bottom edge of font (bit 7=left edge of character, bit 0=right edge of character) -----------------+----------------------------------- +-----+ 1st line | +02h| +-----+ 2nd line | +04h| +-----+ : | : | +-----+ 16th line | +11h| +-----+ (2)16x16 dot font ----------------+----------------------------------- Address | Contents ----------------+----------------------------------- BX:CX+02h | Top left half of font (bit 7=left edge of character) BX:CX+03h | Top right half of font (bit 0=right edge of character) : | BX:CX+20h | Bottom left half of font (bit 7=left edge of character) BX:CX+21h | Bottom right half of font (bit 0=right edge of character) ----------------+----------------------------------- +-----+-----+ 1st line | +02h| +03h| +-----+-----+ 2nd line | +04h| +05h| +-----+-----+ : | : | : | +-----+-----+ 16th line | +20h| +21h| +-----+-----+ DX=Registered character code ---------------------+--------------------------------+---------------------------------------------- Character width | Actual value of JIS kanji code | Value that can be registered within the range ---------------------+--------------------------------+---------------------------------------------- 16 dots (full-width) | 7621-767Eh(*) | 7601-7680h(*) | 7721-777Eh | 7701-7780h | 7821-783Fh | 7801-783Fh | (Total 219 characters) | (Total 319 characters) 8 dots (half-width) | 7840-787Eh | 7840-7880h | 7D21-7D7Eh(*) | 7D01-7D80h(*) | 7E21-7E7Eh | 7E01-7E80h | (Total 251 characters) | (Total 321 characters) =====================+================================+============================================== Full-width and | 376 characters | 512 characters half-width characters| | at the same time, | | Total when used | | ---------------------+--------------------------------+---------------------------------------------- * The characters marked with (*) share space with each other, so they cannot both be used at the same time. For this reason, the total when full-width and half-width characters are used at the same time is less than the simple total of full-width and half-width. Output AH=undefined BX=undefined CX=undefined DX=undefined Explanation o Registers 16x16 dot (full-width) or 8x16 dot (half-width) user-defined characters in the external character generator. o On the PC-H98, full-width and half-width external characters can be registered. When used within the range of JIS kanji codes, 219 and 251 characters can be used, respectively. However, because some codes for full-width and half-width external characters share the same registration area, the total number of characters when using full-width and half-width simultaneously is 376. In reality, the external character generator has an area for 512 characters. Codes outside the range of JIS kanji codes cannot be handled in Shift JIS, but they can be displayed on the screen by writing the character code directly to the text VRAM. u When registering a font with this function, processing is completed faster when the KCG access mode is set to dot access mode. This is because the KCG is always accessible in dot access mode. In code access mode, KCG can only be accessed during the VSYNC period, so it takes time. See "Term: KCG access mode". u When KCG access mode is code access mode, this function waits for the next VSYNC to occur before executing actual processing. To know the timing of VSYNC occurrence, the VSYNC interrupt (INT 0Ah) is used. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt of that routine. If you want to continue generating VSYNC interrupts, you need to OUT to I/O 0064h after executing this function. o Extended kanji are assigned to kanji codes 7921 to 797Eh, 7A21 to 7A7Eh, 7B21 to 7B7Eh, and 7C21 to 7C7Eh, so the half-width external character codes are divided. u Does not work in high-resolution mode. Related INT 18h - Function 14h INT 18h - Function 1Bh Classification CRT BIOS Name Setting KCG access mode Target Normal (except PC-9801 unbranded), high resolution Input AH=1Bh AL=access mode 00h=code access 01h=dot access Output None Explanation o Sets the KCG (Kanji character generator) access mode to dot access or code access. u The original PC-9801 does not have this function. It is always in code access mode. u The technical data book (except for the XA/XL version) states that the AX register is undefined after the function is executed, but in reality it does not change. u Does not work on PC-98LT/HA. The technical data book states that it operates in a compatible manner with normal mode, but since there is no text VRAM, it is always in the same state as dot access mode. Related I/O 0068h - 0Ah,0Bh INT 18h - Function 1Ch Classification CRT BIOS Name CRT Initialization Target Hi-Res Input AH=1Ch AL=Cursor control information bit 7: Blink on/off 1 = On 0 = Off bit 6: Cursor display on/off 1 = On 0 = Off bit 5: KCG access mode 1 = Dot access mode 0 = Code access mode bit 4-0: Cursor blink rate 11111b(Slow) 11110b ↑ : 00010b ↓ 00001b(Fast) 00000b=Default (01100b) DH=Cursor shape (Display start line) DL=Cursor shape (Display end line) * The values of DH and DL are 1/2 of the actual line value. 00-0Eh when 25 lines are displayed, 00-0Bh when 31 lines are displayed * The maximum size is achieved when DH=00h, DL=0Eh (when 25 lines are displayed)/0Bh (when 31 lines are displayed). Output None Explanation o Sets whether to display the cursor, the cursor shape, whether to blink the cursor, the blink rate, and the KCG access mode. Only the start line and end line of the display can be set for the cursor shape. The width is always half-width or full-width. Only the start line and end line of the display can be set for the cursor shape. The width is always half-width or full-width. u This function waits for the next VSYNC to occur before executing the actual processing. The VSYNC interrupt (INT 0Ah) is used to know the timing of the VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue generating VSYNC interrupts, you need to send an OUT to I/O 0064h after executing this function. o Uses the CSRFORM command of the text GDC. Related INT 18h - Function 0Ah (Hi-Res) INT 18h - Function 1Eh INT 18h - Function 1Dh Classification CRT BIOS Name Display width setting Target Hi-Res Input AH=1Dh AL=Physical number of digits managed by GDC (range is an even number between 80 and 162) Output None Explanation o Sets the number of digits per line of text VRAM for GDC. Sets 80 at startup. o Normally, data from offset 00A0h of text VRAM is displayed on the second line of text display (because 2 bytes per digit x 80 digits = 160 = A0h). If you set the physical number of digits managed by GDC to 82 with this function, data from offset 00A4h of text VRAM will be displayed on the second line of text display (because 2 bytes per digit x 82 digits = 164 = A4h). o However, regardless of the setting by this function, the text screen displayed on the screen is always 80 digits. Any part of text VRAM beyond 80 digits will not be displayed on the screen. u This function waits for the next VSYNC occurrence before executing actual processing. The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue to generate VSYNC interrupts, you will need to send an OUT to I/O 0064h after executing this function. o The PITCH command of the text GDC is used. Related INT 18h - Function 1Eh Category CRT BIOS Name Cursor type setting Target Hi-Res Input AH=1Eh AL=Cursor control information Bit 7: Blink on/off 1 = Yes 0 = No Bit 6,5: Unused Bit 4-0: Blink rate 11111b(Slow) 11110b ↑ : 00010b ↓ 00001b(Fast) 00000b=Default (01100b) DH=Cursor display start line DL=Cursor display end line DH=Cursor shape (display start line) DL=Cursor shape (display end line) * The values of DH and DL are 1/2 of the actual line value. 00-0Eh when 25 lines are displayed, 00-0Bh when 31 lines are displayed * The maximum size is achieved when DH=00h, DL=0Eh (when 25 lines are displayed)/0Bh (when 31 lines are displayed). Output None Explanation o Sets the cursor shape, cursor blinking, and blink rate. Only the start and end lines of the cursor shape can be set. The width is always half-width or full-width. u This function waits for the next VSYNC to occur before executing the actual process. The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with the process at this time and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt of that routine. If you want to continue generating VSYNC interrupts, you need to OUT to I/O 0064h after executing this function. o Uses the CSRFORM command of the text GDC. Related INT 18h - Function 1Ch INT 18h - Function 1Fh Category CRT BIOS Name Read font pattern (24 dots) Target Hi-Res Input AH=1Fh DS:BX=First address of font pattern buffer DX=Character code (1)14x24 dot font (ANK) DH=00h DL=Character code (00-FFh) * Specify 00-1Fh to read control characters, and 80-9Fh and E0-FFh to read graphic characters. (2) 14x24 dot font (2 bytes half-width) DX = JIS kanji code (2921-297Eh, 2A21-2A7Eh, 2B21-2B7Eh) * Set the first byte to DH and the second byte to DL * For PC-H98, external characters 7840-787Eh, 7D21-7D7Eh, 7E21-7E7Eh are also 2 bytes half-width (3) 24x24 dot font (2 bytes full-width) DX = JIS code * Set the first byte to DH and the second byte to DL Output DL = Undefined <Font pattern buffer format> ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX~ | Font pattern data | 14x24 dot font...48 bytes | 24x24 dot font...72 bytes ---------------+----------------------------------- <Font pattern data format> (1) 14x24 dot font ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX+00h | Top left half of font (bit 5 = left edge of character) DS:BX+01h | Top right half of font (bit 0 = right edge of character) : | DS:BX+2Eh | Bottom left half of font (bit 5 = left edge of character) DS:BX+2Fh | Bottom right half of font (bit 0 = right edge of character) ---------------+----------------------------------- * Fonts are 14x24 dots, so bits 7 and 6 of even bytes are always 0 +-----+-----+ 1st line | +00h| +01h| +-----+-----+ 2nd line | +02h| +03h| +-----+-----+ : | : | : | +-----+-----+ 24th line | +2Eh| +2Fh| +-----+-----+ (2) 24x24 dot font ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX+00h | Left 1/3 of top edge of font DS:BX+01h | Center 1/3 of top edge of font DS:BX+02h | Right 1/3 of top edge of font : | DS:BX+45h | Left 1/3 of bottom edge of font DS:BX+46h | Center 1/3 of bottom edge of font DS:BX+47h | Right 1/3 of bottom edge of font ---------------+----------------------------------- * The left edge of the character is bit 7, and the right edge is bit 0 +-----+-----+-----+ 1st line | +00h| +01h| +02h| +-----+-----+-----+ Line 2 | +03h| +04h| +05h| +-----+-----+-----+ : | : | : | : | +-----+-----+-----+ Line 24 | +45h| +46h| +47h| +-----+-----+-----+ Explanation o Writes the pattern data of the specified font to the buffer. Pattern data is read from the ANK/Kanji/External Character character generator. o In high-resolution mode, both ANK fonts and 2-byte half-width fonts are fonts with a maximum size of 14x24 dots (this corresponds to box-shaped graphic characters with ASCII code 87h and line fragments with JIS Kanji code 2B60h). u When reading 2-byte character fonts with this function, processing is completed faster when the KCG access mode is set to dot access mode. This is because the KCG is always accessible in dot access mode. In code access mode, the KCG can only be accessed during the VSYNC period, so this takes time. See "Term: KCG access mode". When reading out ANK character fonts, the processing time is the same regardless of the KCG access mode. This is because the character generator can only be accessed during the VSYNC period. u When the KCG access mode is code access mode, this function waits for the next VSYNC to occur before executing the actual processing. The VSYNC interrupt (INT 0Ah) is used to know the timing of the VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue generating VSYNC interrupts, you need to OUT to I/O 0064h after executing this function. Related INT 18h - Function 20h INT 18h - Function 20h Classification CRT BIOS Name User character definition (24 dots) Target High-resolution (excluding PC-H98) Input AH=20h DS:BX=First address of font pattern buffer <Font pattern buffer format> ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX~ | Font pattern data | 24x24 dot font...72 bytes ---------------+----------------------------------- <Font pattern data format> ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX+00h | Left 1/3 of top edge of font DS:BX+01h | Center 1/3 of top edge of font DS:BX+02h | Right 1/3 of top edge of font : | DS:BX+45h | Left 1/3 of bottom edge of font DS:BX+46h | Center 1/3 of bottom edge of font DS:BX+47h | 1/3 to the right of the bottom edge of the font ---------------+----------------------------------- * The left edge of the character is bit 7, and the right edge is bit 0 +-----+-----+-----+ 1st line |+00h |+01h |+02h | +-----+-----+-----+ 2nd line |+03h |+04h |+05h | +-----+-----+-----+ | : | : | : | | : | : | : | +-----+-----+-----+ 24th line |+45h |+46h |+47h | +-----+-----+-----+ DX=Registered character code ------------------+------------------------+-------------------- Model | JIS kanji code | Values that can | Values that can be | actually be registered | registered within | | the range | ------------------+------------------------+-------------------- Other than PC-H98 | 7621-767Eh | 7600-767Fh | 7721-777Eh | 7700-777Fh | (Total 188 characters) | (Total 256 characters) ------------------+------------------------+-------------------- Output DL=Undefined Explanation o Registers a 24x24 dot user-defined character in the external character generator. o The number of character codes that can be registered is 188 characters if they are within the range of the JIS kanji code. In reality, the external character generator has space for 256 characters. Codes outside the range of the JIS kanji code cannot be handled in Shift JIS, but they can be displayed on the screen by writing the character code directly to the text VRAM. u When registering a font with this function, processing is completed faster when the KCG access mode is set to dot access mode. This is because the KCG can be accessed at all times in dot access mode. In code access mode, the KCG can only be accessed during the VSYNC period, so it takes time. See "Term: KCG access mode". u When the KCG access mode is code access mode, this function waits for the next VSYNC to occur before executing actual processing. The VSYNC interrupt (INT 0Ah) is used to know the timing of VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue to generate VSYNC interrupts, you will need to send an OUT to I/O 0064h after executing this function. u The Technical Data Book states that 64 characters from character codes 7620 to 765Fh can be registered, but you can use the character codes shown in the table above. Related INT 18h - Function 1Fh INT 18h - Function 20h (H98) Classification CRT BIOS Name User character definition (24x24 dots, 14x24 dots) Undocumented Target PC-H98 + Hi-Res Input AH=20h DS:BX=First address of font pattern buffer <Font pattern buffer format> ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX~ | Font pattern data | 14x24 dot font...48 bytes | 24x24 dot font...72 bytes ---------------+----------------------------------- <Font pattern data format> (1)14x24 dot font ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX+00h | Top left half of font (bit 5=left edge of character) DS:BX+01h | Top right half of font (bit 0=right edge of character) : | DS:BX+2Eh | Left half of bottom edge of font (bit 5 = left edge of character) DS:BX+2Fh | Right half of bottom edge of font (bit 0 = right edge of character) ---------------+----------------------------------- * The font is 14x24 dots, so bits 7 and 6 of even bytes are not used +-----+-----+ 1st line | +00h| +01h| +-----+-----+ 2nd line | +02h| +03h| +-----+-----+ : | : | : | +-----+-----+ 24th line | +2Eh| +2Fh| +-----+-----+ (2) 24x24 dot font ---------------+----------------------------------- Address | Contents ---------------+----------------------------------- DS:BX+00h | Left 1/3 of top edge of font DS:BX+01h | Center 1/3 of the top edge of the font DS:BX+02h | Right 1/3 of the top edge of the font : | DS:BX+45h | Left 1/3 of the bottom edge of the font DS:BX+46h | Center 1/3 of the bottom edge of the font DS:BX+47h | Right 1/3 of the bottom edge of the font ---------------+----------------------------------- * The left edge of the character is bit 7, and the right edge is bit 0 +-----+-----+-----+ 1st line | +00h| +01h| +02h| +-----+-----+-----+ 2nd line | +03h| +04h| +05h| +-----+-----+-----+ | : | : | : | | : | : | : | +-----+-----+-----+ 24th line | +45h| +46h| +47h| +-----+-----+-----+ DX=Registered character code ---------------------+-------------------------+-------------------- Character width | JIS kanji code | Values that actually | Values that can be | can be registered | registered within | | the range | ---------------------+-------------------------+-------------------- 16 dots (full-width) | 7621-767Eh(*) | 7601-7680h(*) | 7721-777Eh | 7701-7780h | 7821-783Fh | 7801-783Fh | (Total 219 characters) | (Total 319 characters) 8 dots (half-width) | 7840-787Eh | 7840-7880h | 7D21-7D7Eh(*) | 7D01-7D80h(*) | 7E21-7E7Eh | 7E01-7E80h | (Total 251 characters) | (Total 321 characters) =====================+=========================+=================== Full-width and | | half-width characters| | used simultaneously | 376 characters | 512 characters Total when used | | ---------------------+-------------------------+-------------------- * External characters marked with (*) share space with each other, so they cannot be used simultaneously. For this reason, the total when full-width and half-width characters are used simultaneously is less than the simple total of full-width and half-width. Output DL=indefinite Explanation o Register user-defined characters of 24x24 dots (full-width) or 14x24 dots (half-width) in the external character generator. o On the PC-H98, full-width and half-width external characters can be registered. When used within the range of the JIS kanji code, 219 and 251 characters can be used, respectively. However, because some codes for full-width and half-width external characters share the same registration area, the total number of characters that can be used when full-width and half-width characters are used simultaneously is 376. In reality, the character generator for external characters has an area for 512 characters. Codes outside the range of JIS kanji codes cannot be handled in Shift JIS, but they can be displayed on the screen by writing the character code directly to the text VRAM. u When registering a font with this function, processing is completed faster when the KCG access mode is in dot access mode. This is because in dot access mode, the KCG is always accessible. In code access mode, the KCG can only be accessed during the VSYNC period, so it takes time. See "Term: KCG access mode". u When the KCG access mode is in code access mode, this function waits for the next VSYNC to occur before executing the actual processing. The VSYNC interrupt (INT 0Ah) is used to know the timing of the VSYNC occurrence. If there is a problem with this processing and there is another routine that continues to use the VSYNC interrupt, executing this function will stop the VSYNC interrupt for that routine. If you want to continue generating VSYNC interrupts, you will need to send an OUT to I/O 0064h after executing this function. o Extended kanji are assigned to kanji codes 7921-797Eh, 7A21-7A7Eh, 7B21-7B7Eh, and 7C21-7C7Eh, so the half-width external character codes are divided. Related INT 18h - Function 1Fh INT 18h - Function 21h Classification MEMORY SWITCH BIOS Name Read Memory Switch Target Hi-Res, PC-98LT/HA Input AH=21h AL=Memory switch number Hi-Res: 01-08h PC-98LT: 01-1Fh PC-98HA: 01-21h Output DL=Memory switch contents Explanation o Reads from the memory switch. u If a value other than 1-8 is specified for the memory switch number in Hi-Res, an invalid value is read. u The PC-98LT/HA has non-volatile RAM that corresponds to memory switch numbers 00-FFh, but it is unknown whether all of the area can be used as a memory switch. Related Memory Switch List (memsw.txt) INT 18h - Function 22h I/O 0068h - 0Ch,0Dh INT 18h - Function 22h Category MEMORY SWITCH BIOS Name Write Memory Switch Target Hi-Res, PC-98LT/HA Input AH=22h AL=Switch number Hi-Res: 01-08h PC-98LT: 01-1Fh PC-98HA: 01-21h DL=Switch contents Output None Explanation o Writes to the memory switch. u If a value other than 1-8 is specified for the memory switch number in Hi-Res, nothing is done. u The PC-98LT/HA has non-volatile RAM that corresponds to memory switch numbers 00-FFh. All of 00-FFh can be written to with this function, but it is unknown whether all areas can be used as memory switches. Related Memory switch list (memsw.txt) INT 18h - Function 21h I/O 0068h - 0Ch,0Dh INT 18h - Function 23h Category BEEP BIOS Name Setting the buzzer frequency Target Hi-Res Input AH=23h DX=Frequency (38-32,768Hz) Output None Explanation o Sets the buzzer pitch. u The technical data book states that the frequency can be set to 32 (20h)Hz to 32,768 (8000h)Hz, but it must be 38 (26h) or higher. When the system clock is 10MHz (timer clock is 2.5MHz), if a value of 37 (25h) or less is specified, the division value set in the 8253A will exceed 16 bits. The work area for storing the buzzer frequency is only 16 bits, so the pitch cannot be set correctly. The upper limit is actually FFFFh (65.535kHz). However, even if it is within the audible frequency range, if the frequency is set too high, the speaker will not follow it. Related 0000:0490h I/O 0073h INT 18h - Function 24h Classification BEEP BIOS Name Buzzer time setting and sounding Target Hi-Res Input AH=24h CX=Sounding time (unit: 10msec) * No sound when 0 DX=Frequency (38-32,768Hz) Output None Explanation o Beep sounds at the specified time and frequency. The beep is stopped by a timer interrupt, so BIOS processing ends without waiting for the beep to stop. u Executing this function does not affect the default buzzer frequency set in INT 18h - Function 23h. u The technical data book states that the frequency can be specified as 32 (20h) Hz to 32,768 (8000h) Hz, but it must be 38 (26h) or higher. When the system clock is 10MHz (timer clock is 2.5MHz), if you specify a value below 37 (25h), the division value set in the 8253A will exceed 16 bits. Since the work area for storing the buzzer frequency is only 16 bits, the pitch cannot be set correctly. The upper limit is actually FFFFh (65.535kHz). However, even if it is within the audible frequency range, if you set a frequency that is too high, the speaker will not follow. o INT 1Ch - Function 06h sets the division value of the 8253A in the DX register, whereas this function sets the frequency. Related 0000:0448h 0000:044Ah INT 1Ch - Function 06h I/O 0073h INT 18h - Function 25h Subfunction 00h Category CRT BIOS Name Set Emulation VRAM Address Target PC-98LT/HA Input AX=2500h CX=Text code area size DX=Emulation VRAM segment address Output None Explanation o Sets the virtual text VRAM segment and size. When MS-DOS is started, the emulation VRAM segment is 10A0h, and the text code area size is 02E0h. o For details, see the PC-98LT edition of the Technical Data Book. Related INT 18h - Function 25h Subfunction 01h 0000:04F4h 0000:04F6h INT 18h - Function 25h Subfunction 01h Category CRT BIOS Name Get Emulation VRAM Address Target PC-98LT/HA Input AX=2501h Output CX=Text code area size DX=Emulation VRAM segment address Explanation o Returns the position and size of the virtual text VRAM set by INT 18h - Function 25h Subfunction 00h. When MS-DOS is started, the emulation VRAM segment is 10A0h, and the size of the text code area is 02E0h. o For details, see the PC-98LT edition of the Technical Data Book. Related INT 18h - Function 25h Subfunction 00h 0000:04F4h 0000:04F6h INT 18h - Function 26h Classification CRT BIOS Name Display of text on emulation VRAM (Text Display) Target PC-98LT/HA Input AH=26h Output None Explanation o Characters written in the virtual text VRAM that have not yet been displayed are drawn in the graphic VRAM. o For details, see the PC-98LT edition of the Technical Data Book. Related INT 18h - Function 27h Classification CRT BIOS Name Area Scroll Target PC-98LT/HA Input AH=27h AL=Operation 00h: Clear 01h: Vertical scroll 02h: Horizontal scroll BL=Scroll pitch (when AL=01h,02h) CH=Number of lines in rectangular area CL=Number of columns in rectangular area DH=Attribute to be padded DL=Character code to be padded SI=Address of rectangular area (offset on emulation VRAM) DF (Direction Flag)=Scroll direction 1:↓ or → 0:↑ or ← Output None No change in register Explanation o Clears, or vertically or horizontally scrolls the specified rectangular area. The part of the source area that does not overlap with the destination is filled with the specified character (1-byte character) and attribute. o No clipping is performed, so if you specify a move that goes beyond the screen, it will not be transferred correctly. o If you perform an operation that causes the destination to completely exceed the source area, the trajectory of the rectangular area will be padded. Related INT 18h - Function 29h (LT/HA) Figure [Clear: AL=00h,DF=0] Before execution After execution (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ← CL → | | Padding | | SI→↑o------+ | | @@@@@@@@@ | | || | | | @@@@@@@@@ | | CH| | | | @@@@@@@@@ | | || | | | @@@@@@@@@ | | ↓+------+ | | @@@@@@@@@ | | | | | | | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Clear: AL=00h,DF=1] Before execution After execution (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ← CL → | | Padding | | ↑+------+ | | @@@@@@@@@ | | || | | | @@@@@@@@@ | | CH|| | | | @@@@@@@@@ | | || | | | @@@@@@@@@ | | ↓+------o←SI | | @@@@@@@@@ | | | | | | | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Vertical ↑ direction: AL=01h,DF=0] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ↑+------+ | | +-------+ | | BX | | | | | | SI→↓o------+↑ | | | | | | | || | | | | | | | |CH | | +-------+ | | | || | | @@@@@@@@@ | | +------+↓ | | @@@@@@@@@ | | ← CL → | | Padding | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Vertical ↓ direction: AL=01h,DF=1] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ← CL → | | Padding | | ↑+------+ | | @@@@@@@@@ | | || | | | @@@@@@@@@ | | CH| | | | +------+ | | || | | | | | | | ↓+------o↑←SI | | | | | | BL | | | | | | +------+↓ | | +------+ | | | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Horizontal←direction: AL=02h,DF=0] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | SI | | | | ↓ | | | | ←BX→ | | | P | | + o------+↑ | | +------+@@@@@ a | | | | || | | | |@@@@@ d | | | | ||CH | | | |@@@@@ d | | | | || | | | |@@@@@ i | | + +------+↓ | | +------+@@@@@ n | | ← CL → | | g | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Horizontal → direction: AL=02h,DF=1] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ←―CL―→ | | P | | ↑+--------+ + | | a @@@@@+--------+ | | || | | | | d @@@@@| | | | CH| | | | | d @@@@@| | | | || | | | | i @@@@@| | | | ↓+--------o + | | n @@@@@+--------+ | | ←BX→ | | g | | ↑ | | | | SI | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [When the destination jumps over the source area] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | | | | | +--+ + | | @@@@@@@@@@@@@@@@@@+--+ | | | | | | | @@@@@@@@@@@@@@@@@@| | | | +--o + | | @@@@@@@@@@@@@@@@@@+--+ | | ←--BX---→ | | Padding | | ↑ | | | | SI | | | | | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) INT 18h - Function 28h Classification CRT BIOS Name Display one character (Display Character) Target PC-98LT/HA Input AH=28h AL=Attribute BX=Display position (offset address on virtual text VRAM) DX=Character code ■When displaying ANK characters DH=80h DL=Character code (00-FFh) ■When displaying two-byte characters DX=JIS kanji code * Set the first byte to DH and the second byte to DL DF (Direction Flag)=0 Output None Explanation o Displays one character. It writes to both the virtual text VRAM and the graphic VRAM, so when this function is executed, it is displayed on the screen immediately. Related INT 18h - Function 29h (H98) Classification CRT BIOS Name Text scroll (moving a rectangular area) Target PC-H98 Input AH=29h BX=Number of lines in the rectangular area to be moved CX=Number of columns in the rectangular area to be moved DL=Character code to be padded (1-byte character) DH=Attribute to be padded (even address) AL=Extended attribute to be padded (odd address) SI=Source address (text VRAM offset) DI=Destination address (text VRAM offset) DF (Direction Flag)=Scroll direction 1:↓ or → 0:↑ or ← Output AX=Undefined BX=Undefined CX=Undefined DX=Undefined SI=Undefined DI=Undefined DF=Undefined Explanation o Scrolls vertically or horizontally in the specified rectangular area. The part of the source area that does not overlap with the destination is filled with the specified character (1-byte character) and attribute. The direction of movement is determined by the SI and DI registers and the state of the DF flag. o No clipping is performed, so if a movement that goes beyond the screen is specified, the transfer will not be successful. o The transfer direction and DF state are not checked, so the user program must provide appropriate parameters. o Diagonal movement (horizontal and vertical simultaneously) is not possible. If such parameters are provided, padding will not be performed correctly. o When an operation is performed such that the destination completely passes over the source area, the trajectory of the rectangular area is padded. u In the PC-H98 series technical data book, the BP register is undefined after the function is executed, but in reality it does not change. Related Table [Vertical ↑ direction] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | DF=0 DI→o | | DI→o------+ | | | | | | | | SI→o------+↑ | | SI→| | | | | || | | | | | | | |CX | | +------+ | | | || | | @@@@@@@@ | | +------+↓ | | Padding→@@@@@@@@ | | ← BX → | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Vertical ↓ direction] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ← BX → | | | | ↑+------+ | | Padding →@@@@@@@@ | | || | | | @@@@@@@@ | | CX| | | | +------+ | | || | | | | | | | ↓+------o←SI | | | |←SI | | | | | | | | DF=1 o←DI | | +------o←DI | | | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Horizontal←direction] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | DI SI | | DI SI P | | DF=0 ↓ ↓ | | ↓ ↓ a | | o o------+↑ | | o------+@@@@ d | | | || | | | |@@@@ d | | | |CX | | | |@@@@ i | | | || | | | |@@@@ n | | +------+↓ | | +------+@@@@ g | | ← BX → | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [Horizontal → direction] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | ← BX → | | | | ↑+--------+ | | @@@+--------+ | | || | | | @@@| | | | CX| | | | @@@| | | | || | | | @@@| | | | ↓+--------o o | | @@@+--------o | | ↑ ↑ | | ↑ ↑ | | SI DI DF=1 | | SI DI | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) [When the destination jumps over the source area] Before transfer After transfer (0,0) (79,0) (0,0) (79,0) +---------------------------+ +---------------------------+ | | | | | +--+ | | @@@@@@@@@@@@@@@@@@+--+ | | | | | | @@@@@@@@@@@@@@@@@@| | | | +--o o | | @@@@@@@@@@@@@@@@@@+--o | | ↑ ↑ | | ↑ ↑ | | SI DI | | SI DI | | | | | +---------------------------+ +---------------------------+ (0,24) (79,24) (0,24) (79,24) INT 18h - Function 29h (LT/HA) Classification CRT BIOS Name Area scrolling subcontractor processing Undocumented Target PC-98LT/HA Input AH=29h AL=00h BX=Number of lines in the rectangular area to be moved CX=Number of columns in the rectangular area to be moved DH=Attribute to be padded DL=Character code to be padded SI=Source address (offset in emulation VRAM) DI=Destination address (offset in emulation VRAM) DF=Data transfer direction ↑ or ← 0 ↓ or → 1 Output None No change in register Explanation o Scrolls vertically or horizontally for the specified rectangular area. The part of the source area that does not overlap with the destination area is filled with the specified character (1-byte character) and attribute. The direction of movement is determined by the state of the SI and DI registers and the DF flag. o No clipping is performed, so if you specify a move that goes beyond the screen, the transfer will not be performed correctly. o There is no check of the transfer direction and DF status, so the user program must provide the appropriate parameters. o Diagonal movement (horizontal and vertical at the same time) is not possible. If such parameters are provided, padding will not be performed correctly. o When an operation is performed such that the destination completely exceeds the source area, the path of the rectangular area will be padded. o See the table in INT 18h - Function 29h (H98) u Used as a sub-processor for INT 18h - Function 27h, etc. Related INT 18h - Function 27h INT 18h - Function 2Ah Classification CRT BIOS Name Extended attribute mode setting Target PC-H98 Input AH=2Ah AL=Mode setting information bit 7,6: Attribute mode 11b=Unused 10b=Extended attribute EGH mode 01b=Extended attribute JEH mode 00b=Previously compatible attribute PC mode (startup setting) * When the text screen is 40 columns in normal mode, regardless of the specified value it will be the same as specifying 00b bit 5: Unused (specify 0) bit 4: Unused (specify 0) bit 3: Reserved (display type in high-resolution mode) (specify 0) bit 2: Border color 1=Follows I/O set value (value set in INT 18h - Function 2Ch) 0=Follows VRAM attribute (startup setting) * When the text screen is 40 columns in normal mode, regardless of the specified value, it will be the same as specifying 0. bit 1: Unknown (Undocumented) 1 = Unknown 0 = Startup setting bit 0: CRT line mode (Undocumented) ■Normal mode, horizontal scan frequency 31 kHz 1 = 25 lines of space between lines 0 = Normal 20/25 line mode (startup setting) ■Normal, horizontal scan frequency 24 kHz, high resolution Cannot be set (always 0) Output AX = Undefined Description o Sets the mode of the text screen display extended by PC-H98. To read the mode set by this function, use INT 18h - Function 2Bh. o When this function is executed, it will always be in 25 line mode. o AL bits 7 and 6 select one of three attribute modes. For details on attribute modes, see "Term: Extended Attributes". u AL bits 5 and 4 are unused. Bit 3 cannot be set because it is used to return the display type in high-resolution mode when reading the mode setting status with INT 18h - Function 2Bh. Notes regarding the setting of bits 5-3 are as follows. The setting value of this function is saved at 0000:0459h in the system common area. In high-resolution mode, even if you try to change the values of bits 5-3 with this function, the same bits in the system common area will not change. In normal mode, the values of bits 5-3 are reflected directly in the same bits in the system common area. For this reason, it is recommended to set 000b in normal mode. +-----------------+--------------------------+ | Mode | Can bits 5-3 be changed? | +-----------------+--------------------------+ | High-resolution | Cannot be changed | | Normal | Can be changed | +-----------------+--------------------------+ o AL bit 2 selects the method for specifying the border color. The ruled lines referred to here do not refer to line fragments of 2-byte characters, but to underlines, vertical lines, and overlines specified by attributes. If 0 is specified, the ruled lines are displayed in the color specified by the attribute (character color). The color can be set on a character-by-character basis, but the color will be the same as the characters displayed in the same position. If 1 is specified, all ruled lines are displayed in the color specified by INT 18h - Function 2Ch. The color can be different from the color of the characters displayed in the same position. The behavior of u AL bit 1 is unknown. With u AL bit 0, you can select 25 lines with space between lines only when the horizontal scan frequency is 31kHz in normal mode. The horizontal scan frequency can be found by checking 0000:054Ch bit 5 in the system common area. When 1 is specified, only 25 lines with space between lines can be displayed. It is not possible to display 20 or 30 lines like the PC-9821 (except Bf, Bp, Bs, Be, and Ts). In the PC-H98 series technical data book, the BP register is undefined after the function is executed, but in reality it does not change. Related INT 18h - Function 2Bh INT 18h - Function 2Ch INT DCh - Function 14h Subfunction 0010h,0011h 0000:0459h I/O 006Eh INT 18h - Function 2Bh Classification CRT BIOS Name Get extended attribute mode Target PC-H98 Input AH=2Bh Output AL=Mode setting information bit 7,6: Attribute mode 11b=Reserved 10b=Extended attribute EGH mode 01b=Extended attribute JEH mode 00b=Previously compatible attribute PC mode (startup setting) bit 5: Unused bit 4: Unused bit 3: PC-H98 high-resolution mode display type (Undocumented) ■[High-resolution] 1=Non-interlaced 0=Interlaced * Startup setting depends on connected display bit 2: Border color 1=Follows I/O set value (INT 18h - Function 2Ch setting) 0=Follows VRAM attribute (startup setting) bit 1: Unknown (Undocumented) 1=Unknown 0=Startup setting bit 0: CRT line mode (Undocumented) ■[Normal mode, horizontal scan frequency 31kHz] 1=25 lines of space between lines 0=Normal 20/25 lines mode (startup setting) ■[Normal, horizontal scan frequency 24kHz, high resolution] Always 0 AH=Undefined Explanation o Reads the mode of the text screen display extended by the PC-H98. Mode setting is performed by INT 18h Function 2Ah. Actual processing is simply reading the value from the system common area 0000:0459h. u In the PC-H98 series technical data book, the BP register is undefined after the function is executed, but in reality it does not change. Related INT 18h Function 2Ah 0000:0459h INT 18h - Function 2Ch Classification CRT BIOS Name Set border color Target H98 Input AH=2Ch AL=Border color bit 7-4:0000b bit 3 :I=Intensity bit 2 :G=Green bit 1 :B=Blue bit 0 :R=Red Output AX=Undefined Explanation o Sets the border color. The border here does not refer to the border fragment of a 2-byte character, but to the underline, vertical line, and overline specified by the attribute. When AL bit 2=1 (border color is I/O set dependent) is set in INT 18h - Function 2Ah, all borders are displayed in the color specified by this function. u In the PC-H98 series technical data book, the BP register is undefined after the function is executed, but in reality it does not change. Related INT 18h - Function 2Ah I/O 00A7h INT 18h - Function 2Dh Classification CRT BIOS Name No operation Undocumented Target PC-H98 + Normal Input AH=2Dh Output None Explanation o Returns without doing anything. Related INT 18h - Function 30h Classification CRT BIOS Name Extended screen mode setting Undocumented Target PC-98GS, PC-9821 (except Ts) [Normal], PC-9801BA2・BS2・BX2 Input AH=30h AL=Mode setting information bit 7-4: Set 0000b (executing with anything other than 0 will result in an abnormal end) bit 3,2: Horizontal scan frequency ------+---------------------------+------ Value | Horizontal scan frequency | Notes ------+---------------------------+------ 11b | 31.47kHz | 10b | 24.83kHz | 01b | Unused | 00b | 15.73kHz | *1 ------+---------------------------+---- *1 Can only be set on PC-98GS. Video mode that outputs NTSC video signals Related I/O 09A8h Bit 1: Synchronization mode [PC-98GS] 1 = External synchronization (can only be selected when the horizontal scanning frequency is 15.73kHz) 0 = Internal synchronization (set at startup) * Always set to 0 on systems other than the PC-98GS Bit 0: Raster scan mode 1 = Interlace 0 = Non-interlace * On the PC-98GS, it can be set to 0 for 24.83kHz and 31.47kHz, and to 1 only for 15.73kHz. * Normally set to 0 on systems other than the PC-98GS. It can be set to 1 on systems other than the original PC-9821, but this does not result in interlaced display. Also, setting it to 1 makes the value of 0000:053Bh invalid, and the text screen will be distorted the next time INT 18h - Function 0Eh, 0Fh, 11h, etc. are executed. * On the original PC-9821, if you run it with 1, it will end abnormally. Related 0000:0459h bit 3 BH=resolution and number of lines bit 7,6: Set 00b (running with anything other than 0 will end abnormally) bit 5,4: Graphics resolution ------+---------------------+------ Value | Graphics resolution | Notes ------+---------------------+------ 11b | 640x480 | *1 10b | 640x400 | *2,*3 01b | 640x200(LOWER) | *2 00b | 640x200(UPPER) | *2,*4 ------+---------------------+------ *1 - On the PC-98GS, it can be set when the horizontal scan frequency is 15.73kHz or 31.47kHz. It will be set to GS extended graphics mode. - On the PC-9821 (excluding Bf, Bp, Bs, and Be), this can only be set when the horizontal scan frequency is 31.47 kHz. The system will be set to extended graphics mode. - Cannot be set on the PC-9821Bf, Bp, Bs, and Be, or the PC-9801BA2, BS2, and BX2. *2 - On the PC-98GS, this can only be set when the horizontal scan frequency is 15.73 kHz or 24.83 kHz. - On the PC-9821 original and Ne, this can only be set when the horizontal scan frequency is 24.83 kHz. - On the PC-9821 (excluding the original and Ne), and the PC-9801BA2, BS2, and BX2, this can only be set when the horizontal scan frequency is 24.83 kHz or 31.47 kHz. *3 - On the PC-9821 (excluding Bf, Bp, Bs, and Be), the standard/extended graphics mode will remain the same as before. To change the graphics mode, use INT 18h - Function 4Dh. - PC-98GS, PC-9821Bf/Bp/Bs/Be, PC-9801BA2/BS2/BX2 only support 2/8/16 color modes. *4 - Startup setting Related 0000:0459h bit 0 0000:054Dh bit 7 0000:0597h bit 1,0 INT 18h - Function 42h bit 3,2: Set 00b (executing with anything other than 0 will result in an abnormal termination) bit 1,0: Number of text lines ------+----------------------+----------------------------------- Value | Number of text lines | Notes ------+----------------------+----------------------------------- 11b | Setting prohibited | Setting this value will result in an abnormal termination 10b | 30 lines | Can only be set at 640x480 01b | 25 lines | 00b | 20 lines | ------+----------------------+----------------------------------- Related 0000:053Ch bit 4,0 INT 18h - Function 0Ah,0Bh Output BH=Exit code 00h: Normal termination 01h: Abnormal termination ■When BH=00h AL=00h (normal termination) ■When BH=01h AL=Error type 01h: Input parameter error 02h: Unknown AH=Undefined Description o Sets the extended screen display mode on the PC-9821 (except Ts) and PC-9801BA2/BS2/BX2 (PC-9821Ts does not support this function). To read out the mode set with this function, use INT 18h - Function 31h. o The settable mode combinations vary depending on the model (table: Possible combinations for extended screen mode settings). If an unsettable parameter is specified, this function will be inoperative. If a settable parameter is specified and the function terminates normally, the text screen display and cursor display will be turned off. u On the PC-9821Af/Ap/As/Ae/Ap2/As2/Ce/Cs2/Ce2, setting AL bit 0 to 1 will cause the work area (0000:053Bh) in the system common area, which indicates the number of rasters per CRT line - 1, to be set to half the actual value. Note that if you execute INT 18h - Function 0Eh, 0Fh, 11h, etc. in this state, the text screen will not be displayed correctly. Normally, input AL bit 0 is set to 0. Executing this function with u AL=0Dh, BH=31h will cause the PC-9821 (except the original, Bf, Bp, Bs and Be) to go out of control. This combination is not possible on the PC-98GS, PC-9821 original, Bf, Bp, Bs and Be, and PC-9801BA2, BS2 and BX2, so the system will simply terminate with an error. Related INT 0Ah INT 18h - Function 31h INT 18h - Function 4Dh INT DCh - Function 14h Subfunction 0010h,0011h 0000:045Ch bit 6 0000:054Dh bit 7,2 0000:0597h bit 7 F8E8:0004h bit 7 Table Possible combinations for extended screen mode settings ----------+----------------------------------------+--------------------------------------+---+------------+---+---+---+---+---+---+---+ Input | Output video signal | Screen display |PC-| PC-9821 |PC-| Parameter | | |98 | |Af |Ne |Ce |Ap2|Bf |Cs2|9801 -----+----+---------------+-------------+----------+----------+-----------+---------------+GS | |Ap | | |As2|Bp |Ce2|BA2| AL |BH |Horizontal scan|Vertical sync|CRT |Graphics |Graphics |Text | |Initial |As | | | |Bs | |BS2| | |Frequency |Frequency |Resolution|Resolution|Quick mode |Number of lines| |Alternative |Ae | | | |Be | |BX2| -----+----+---------------+-------------+----------+----------+-----------+---------------+---+------------+---+---+---+---+---+---+---+ 01h |00h |15.73kHz |59.94Hz |640x480 |640x200 |Standard | 20 | ○ | − | − | − | − | − | − | − | − | 01h |01h | ↑ | ↑ | ↑ |(UPPER) | ↑ | 25 | ○ | − | − | − | − | − | − | − | − | 01h |10h | ↑ | ↑ | ↑ |640x200 | ↑ | 20 | ○ | − | − | − | − | − | − | − | − | 01h |11h | ↑ | ↑ | ↑ |(LOWER) | ↑ | 25 | ○ | − | − | − | − | − | − | − | − | 01h |20h | ↑ | ↑ | ↑ |640x400 |Standard | 20 | ○ | − | − | − | − | − | − | − | − | 01h |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | ○ | − | − | − | − | − | − | − | − | 01h |30h | ↑ | ↑ | ↑ |640x480 |GS Extended| 20 | ○ | − | − | − | − | − | − | − | − | 01h |31h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | ○ | − | − | − | − | − | − | − | − | 01h |32h | ↑ | ↑ | ↑ | ↑ | ↑ | 30 | ○ | − | − | − | − | − | − | − | − | 08h |00h |24.83kHz |56.42Hz |640x400 |640x200 |Standard | 20 | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 08h |01h | ↑ | ↑ | ↑ |(UPPER) | ↑ | 25 | ◎ | ◎ | ○ | ○ | ◎ | ○ | ○ | ○ | ○ | 08h |10h | ↑ | ↑ | ↑ |640x200 | ↑ | 20 | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 08h |11h | ↑ | ↑ | ↑ |(LOWER) | ↑ | 25 | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 08h |20h | ↑ | ↑ | ↑ |640x400 | Standard | 20 | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 08h |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 08h |20h | ↑ | ↑ | ↑ |640x400 | Extended | 20 | − | ○ | ○ | ○ | ○ | ○ | − | ○ | − | 08h |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | ○ | ○ | ○ | ○ | ○ | − | ○ | − | 09h |00h | ↑ | ↑ | ↑ |640x200 | Standard | 20 | − | − | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 09h |01h | ↑ | ↑ | ↑ |(UPPER) | ↑ | 25 | − | − | ◎1| ◎ | ○ | ◎1| ◎1| ◎1| ◎1| 09h |10h | ↑ | ↑ | ↑ |640x200 | ↑ | 20 | − | − | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 09h |11h | ↑ | ↑ | ↑ |(LOWER) | ↑ | 25 | − | − | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 09h |20h | ↑ | ↑ | ↑ |640x400 | Standard | 20 | − | − | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 09h |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | ○ | ○ | ○ | ○ | ○ | ○ | ○ | 09h |20h | ↑ | ↑ | ↑ |640x400 | Extended | 20 | − | − | ○ | ○ | ○ | ○ | − | ○ | − | 09h |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | ○ | ○ | ○ | ○ | − | ○ | − | 0Ch |00h |31.47kHz |70.10Hz |640x400 |640x200 | Standard | 20 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Ch |01h | ↑ | ↑ | ↑ |(UPPER) | ↑ | 25 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Ch |10h | ↑ | ↑ | ↑ |640x200 | ↑ | 20 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Ch |11h | ↑ | ↑ | ↑ |(LOWER) | ↑ | 25 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Ch |20h | ↑ | ↑ | ↑ |640x400 | Standard | 20 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Ch |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Ch |20h | ↑ | ↑ | ↑ |640x400 | Extended | 20 | − | − | ○ | − | ○ | ○ | − | ○ | − | 0Ch |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | ○ | − | ○ | ○ | − | ○ | − | 0Ch |30h | ↑ |59.94Hz |640x480 |640x480 | Extended | 20 | − | ○ | ○ | ○ | ○ | ○ | − | ○ | − | 0Ch |31h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | ○ | ○ | ○ | ○ | ○ | − | ○ | − | 0Ch |32h | ↑ | ↑ | ↑ | ↑ | ↑ | 30 | − | ○ | ○ | ○ | ○ | ○ | − | ○ | − | 0Ch |30h | ↑ |59.94Hz |640x480 |640x480 |GS Extended| 20 | ○ | − | − | − | − | − | − | − | − | 0Ch |31h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | ○ | − | − | − | − | − | − | − | − | 0Ch |32h | ↑ | ↑ | ↑ | ↑ | ↑ | 30 | ○ | − | − | − | − | − | − | − | − | 0Dh |00h | ↑ |70.10Hz |640x400 |640x200 |Standard | 20 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Dh |01h | ↑ | ↑ | ↑ |(UPPER) | ↑ | 25 | − | − | ◎2| − | ○ | ◎2| ◎2| ◎2| ◎2| 0Dh |10h | ↑ | ↑ | ↑ |640x200 | ↑ | 20 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Dh |11h | ↑ | ↑ | ↑ |(LOWER) | ↑ | 25 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Dh |20h | ↑ | ↑ | ↑ |640x400 |Standard | 20 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Dh |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | ○ | − | ○ | ○ | ○ | ○ | ○ | 0Dh |20h | ↑ | ↑ | ↑ |640x400 |Extended | 20 | − | − | ○ | − | ○ | ○ | − | ○ | − | 0Dh |21h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | ○ | − | ○ | ○ | − | ○ | − | 0Dh |30h | ↑ |59.94Hz |640x480 |640x480 |Extended | 20 | − | − | ○ | ○ | ○ | ○ | − | ○ | − | 0Dh |31h | ↑ | ↑ | ↑ | ↑ | ↑ | 25 | − | − | × | × | × | × | − | × | − | 0Dh |32h | ↑ | ↑ | ↑ | ↑ | ↑ | 30 | − | − | ○ | ○ | ○ | ○ | − | ○ | − | -----+----+---------------+-------------+----------+----------+-----------+---------------+---+------------+---+---+---+---+---+---+---+ ○=Can be set −=Cannot be set ×=Prohibited to set (running with this parameter may result in an internal loop that cannot be broken) ◎=Startup state ◎1=Startup state (when [GRPH]+[1]+[RESET] is set) ◎2=Startup state (when [GRPH]+[2]+[RESET] is set) * Selection of standard/extended graphics when the graphics resolution is 640x400 is performed with INT 18h - Function 4Dh. It cannot be set directly with INT 18h - Function 30h. * If a CRT resolution of 640x480 is specified on a PC-98GS, the GS extended graphics mode will be set. The PC-98GS cannot be set to PC-9821-compatible extended graphics mode. On the other hand, CRT resolution on PC-9821 INT 18h - Function 31h Classification CRT BIOS Name Get extended screen mode Undocumented Target PC-98GS, PC-9821 (except Ts) [Normal], PC-9801BA2, BS2, BX2 Input AH=31h Output AL=Mode setting information bit 7-4: Unused bit 3,2: Horizontal scan frequency ------+---------------------------+------ Value | Horizontal scan frequency | Notes ------+---------------------------+------ 11b | 31.47kHz | 10b | 24.83kHz | 01b | Unused | 00b | 15.73kHz | Video mode for outputting NTSC video signals on PC-98GS ------+---------------------------+------ Related I/O 09A8h bit 1: Synchronous mode [PC-98GS] 1 = External synchronization (only when horizontal scan frequency is 15.73kHz) 0 = Internal sync (startup setting) * Always 0 except for PC-98GS bit 0: Raster scan mode 1 = Interlace 0 = Non-interlace * For PC-98GS, 0 for 24.83kHz, 31.47kHz, 1 for 15.73kHz * Some models show 1 at startup, but this does not mean that an interlaced signal is actually output. The reason for showing 1 is unknown. Related 0000:0459h bit 3 BH=resolution, number of lines bit 7,6: Unused bit 5,4: Graphic resolution ------+--------------------+-------------------- Value | Graphic resolution | Notes ------+--------------------+-------------------- 11b | 640x480 | 256 colors 10b | 640x400 | 2,8,16,256 colors 01b | 640x200(LOWER) | 2,8,16 colors 00b | 640x200(UPPER) | 2,8,16 colors ------+--------------------+-------------------- * If you change the graphic resolution with INT 18h - Function 42h, it will be reflected in the value read by this function. Related 0000:0459h bit 0 0000:054Dh bit 7 0000:0597h bit 1,0 bit 3,2: Unused bit 1,0: Number of lines of text ------+------------------------ Value | Number of lines of text ------+------------------------ 11b | Unused 10b | 30 lines 01b | 25 lines 00b | 20 lines ------+------------------------ Related 0000:053Ch bit 4,0 * If the number of lines of text is changed with INT 18h - Function 0Ah, it will be reflected in the value read by this function. Description o Reads the mode of the extended screen display on the PC-9821 (except Ts) and PC-9801BA2, BS2, and BX2 (PC-9821Ts does not support this function). The mode is set using INT 18h Function 30h. o The graphics mode type for 640x400 cannot be obtained from the BIOS. Related INT 18h - Function 30h INT 18h - Function 4Dh 0000:045Ch bit 6 0000:054Dh bit 7,2 0000:0597h bit 7 F8E8:0004h bit 7